$(function() { 
	
	var mapCanvas = $('#mapCanvas');
	$('#type').ddslick().show();		
	$('#category').ddslick().show();	
	map(mapCanvas, 2, {});
	$('#frmSearch').submit(function(){
		var kind		= $('#type input.dd-selected-value').val();
		var category	= $('#category input.dd-selected-value').val();
		var province	= $('#province input.dd-selected-value').val();
		province		= province > 0 ? $('#province label.dd-selected-text').html() : '';
		var district	= $('#district input.dd-selected-value').val();
		district		= district > 0 ? $('#district label.dd-selected-text').html() : '';
		var keyword 	= $('#key').val();
		var opt			= {keyword:keyword, prov:province, dist:district, kind:kind, cate:category};		
		mapCanvas.gmap('destroy');
		map(mapCanvas, 3, opt);
		return false;
	});
});

